package com.jiesen.base.modules.login.jsRole.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jiesen.base.modules.login.jsPermission.model.Permission;
import com.jiesen.base.utils.PageDto;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@TableName("sys_role")
public class JsRole extends PageDto {

    @TableId(type = IdType.AUTO)
    private Integer id;             //角色信息
    @TableField("`sort`")
    private Integer sort;           //排序
    private String name;           //角色名称
    @TableField("`lock`")
    private String lock;         //使用状态
    private String description;    //备注
    private Integer branchId;       //所属分校
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updatetime;     //修改时间
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date addtime;        //添加时间

    @TableField(exist = false)
    private List<Permission> permissions;

    @TableField(exist = false)
    private List<Integer> pids;      //权限id列表
}
